package com.kun.lagou.seckillservice.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.Instant;

/**
 * 秒杀订单
 * @author Administrator
 */
@Entity
@Table(name = "t_lagou_seckill_order", indexes = {@Index(columnList = "userId,activityId", unique = true)})
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SeckillOrder {
    @Id
    @GeneratedValue
    private long id;

    private long userId;
    private long activityId;

    @CreationTimestamp
    private Instant createTime;
    @UpdateTimestamp
    private Instant updateTime;
}
